package shape;

import java.awt.*;

import color.ColorCheck;

/**
 * Implements Circle object
 * */

public class Circle
{
    
    // Attributes of the circle object
    private double cx;
    private double cy;
    private double radius;
    private Color  fillColor;
    private Color  stroke;
    private double strokeWidth;
    ColorCheck     ck = new ColorCheck();
    
    /**
     * 
     * @param cx
     *            horizontal distance to circle objects from (0,0)
     * @param cy
     *            vertical distance to circle objects from (0,0)
     * @param radius
     *            radius of the circle
     */
    public Circle(double cx, double cy, double radius)
    {
        
        this.cx = cx;
        this.cy = cy;
        this.radius = radius;
        this.fillColor = Color.black;
    }
    
    /**
     * 
     * @param cx
     *            horizontal distance to circle objects from (0,0)
     * @param cy
     *            vertical distance to circle objects from (0,0)
     * @param radius
     *            radius of the circle
     * @param filiiColor
     *            filling color of the circle
     */
    public Circle(double cx, double cy, double radius, String fillColor)
    {
        
        this.cx = cx;
        this.cy = cy;
        this.radius = radius;
        this.fillColor = ck.getColor(fillColor);
    }
    
    /**
     * 
     * @param cx
     *            horizontal distance to circle objects from (0,0)
     * @param cy
     *            vertical distance to circle objects from (0,0)
     * @param radius
     *            radius of the circle
     * @param fillcolor
     *            filling color of the circle
     * @param stroke
     *            color of the circle
     * @param strokeWidth
     *            stroke Width of the circle
     */
    public Circle(double cx, double cy, double radius, String fillColor,
            String stroke, double strokeWidth)
    {
        
        this.cx = cx;
        this.cy = cy;
        this.radius = radius;
        this.fillColor = ck.getColor(fillColor);
        this.strokeWidth = strokeWidth;
        this.stroke = ck.getColor(stroke);
    }
    
    /**
     * @return cx in pixels
     */
    public double getCx()
    {
        return cx;
    }
    
    /**
     * @return cy in pixels
     */
    public double getCy()
    {
        return cy;
    }
    
    /**
     * @return radius in pixels
     */
    public double getRadius()
    {
        return radius;
    }
    
    /**
     * @return Filling Color as Color
     */
    public Color getFillColor()
    {
        return fillColor;
    }
    
    /**
     * @return Stroke Color as Color
     */
    public Color getStroke()
    {
        return stroke;
    }
    
    /**
     * @return strokeWidth in pixels
     */
    public double getStrokeWidth()
    {
        return strokeWidth;
    }
    
    // Prints circle details for debugging
    public void print()
    {
        
        System.out.println("Circle");
        System.out.println("cx  = " + this.cx);
        System.out.println("cy  = " + this.cy);
        System.out.println("radius = " + this.radius);
        System.out.println("fillColor = " + this.fillColor);
        System.out.println("stroke = " + this.stroke);
        System.out.println("strokeWidth = " + this.strokeWidth);
        
    }
    
}
